class DClient:
    def __init__(self, remote: str, model_list: []):
        self._remote = remote
        self._weight = 0
        self._active_model_set = set()
        self._model_set = set(model_list)
        self._model_detail_dict = {}

    @property
    def remote(self):
        return self._remote

    @property
    def weight(self):
        return self._weight

    @weight.setter
    def weight(self, w):
        self._weight = w

    def model_list(self):
        return list(self._model_set)

    def model_detail(self, model: str):
        return self._model_detail_dict.get(model)

    def model_detail_list(self, model_list: []):
        detail_list = []
        for m in model_list:
            if m in self._model_detail_dict:
                detail_list.append(
                    self._model_detail_dict[m]
                )
        return detail_list

    def update_model_detail_list(
            self, model_detail_list: []):
        for d_info in model_detail_list:
            self._model_detail_dict.update({
                d_info['name']: d_info
            })

    def activate_model(self, model: str):
        if model in self._model_set:
            self._active_model_set.add(model)

    def deactivate_model(self, model: str):
        self._active_model_set.discard(model)

    def model_exist(self, model: str):
        return model in self._model_set

    def __lt__(self, other):
        return self._weight < other.weight

    def __le__(self, other):
        return self._weight <= other.weight

    def __ne__(self, other):
        return self._weight != other.weight

    def __eq__(self, other):
        return self._weight == other.weight

    def __gt__(self, other):
        return self._weight > other.weight

    def __ge__(self, other):
        return self._weight >= other.weight
